<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <title>[title] - <{$siteName}> - <{$siteSubName}></title>
    <meta name="keywords" content="[keywords],<{$siteKw}>" />
    <meta name="description" content="<{$siteDesc}>" />
    <meta name="author" content="Jerry Locke">
    <meta name="copyright" content="Zulwi Studio">
    <link href="" rel="shortcut icon" />
    <link rel="stylesheet" href="__PUBLIC__/static/css/style.css" />
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/static/css/jquery.Jcrop.min.css" media="all">
</head>
<body>
	<div class="headerBox">
        <div class="nav container">
        	<div class="logo fl">
            <a href="/"><img id="logo" src="__PUBLIC__/static/img/logo.png" /></a>
            </div>
            <div class="navList fl">
            <ul>
                <li<?php if($nowNav==0) echo ' class="current"'; ?>><a href="/">首页</a></li>
                <li<?php if($nowNav==1) echo ' class="current"'; ?>><a href="/b">教辅</a></li>
                <li<?php if($nowNav==2) echo ' class="current"'; ?>><a href="/v">视频</a></li>
                <li<?php if($nowNav==3) echo ' class="current"'; ?>><a href="/e">测验</a></li>
                <li<?php if($nowNav==4) echo ' class="current"'; ?>><a href="/i">空间</a></li>
            </ul>
            </div>
            <div class="searchForm fl">
                <form action="/s" method="get">
                    <input type="text" class="searchtext" placeholder="搜索" name="key" autocomplete="off"
                    spellcheck="false" max-length="140">
                    <input type="submit" class="searchbutton" value=" " title="点此搜索">
                </form>
            </div>
            <div class="avatar fr">
            	<div class="avatarc" title="点击展开/关闭下拉列表">
                <div class="avatarImg fr">
				<?php if(isEmpty($_SESSION['uid'])): ?>
                <img src="__PUBLIC__/static/img/noavatar.png" />
				<?php else: ?>
				<img src="<{$userInfo.avatar.50}>" />
				<?php endif; ?>
                </div>
                <div class="avatarName fr">
                	<?php if(isEmpty($_SESSION['uid'])): ?>
                    <a href="/u/login" id="login-href" title="点此登录">登录</a>&nbsp;&nbsp;&nbsp;
                    <a href="/u/reg" title="立即注册">注册</a>&nbsp;&nbsp;&nbsp;
                    <?php else: ?>
                    <a href="javascript:;" id="my-href" title="点击展开个人信息"><{$userInfo.username}></a>
                    <?php endif; ?>
                </div>
                </div>
              <?php if(isEmpty($_SESSION['uid'])): ?>
              <div id="topDropMenu" class="loginBox box">
                  <form id="loginBarForm" action="/u/dologin" method="post" onSubmit="return post_form('/u/dologin',this,'loginTips');">
                  	  <div id="loginTips" class="tip">登录提示</div>
                      <label for="username">帐号/电子邮箱</label>
                      <p><input type="text" id="username" name="username" class="text" value=""/></p>
                      <label for="password">密码</label>
                      <p><input type="password" id="password" name="password" class="text" value=""/></p>
                      <p><a href="/u/reg">注册帐号</a><a href="/u/resetpwd">找回密码</a><input type="submit" class="btn fr" value="登录" /></p>
                  </form>
              </div>
              <?php else: ?>
              <div id="topDropMenu" class="box userMenu">
              		<div class="userInfo fl">
                    	<div class="avatarInfo fl">
                        	<img src="<{$userInfo.avatar.300}>">
                        </div>
                        <div class="name fl">
                            <h6 title="用户名：<{$userInfo.username}>"><{$userInfo.username}></h6>
                            <p title="邮箱：<{$userInfo.email}>"><{$userInfo.email}></p>
                            <p><?php switch($userInfo['sex']){case 1: echo "<span style='color:#2fa5f5;font-weight:bold;' title='性别'>♂</span>";break;case 2: echo "<span style='color:#da2b62;font-weight:bold;' title='性别'>♂</span>";break;default: echo "<span style='color:#2fa5f5;font-weight:bold;' title='性别'>?</span>";} ?>&nbsp;&nbsp;17岁</p>
                        </div>
                        <div class="line clearfix"></div>
                        <div class="content">
                        <p>积分&nbsp;&nbsp;&nbsp;&nbsp;<{$userInfo.credit}></p>
						<p>信誉&nbsp;&nbsp;&nbsp;&nbsp;<{$userInfo.integration}></p>
                        <p>状态&nbsp;&nbsp;&nbsp;&nbsp;<{$userInfo.count.moods}> 条</p>
						<p>评论&nbsp;&nbsp;&nbsp;&nbsp;<{$userInfo.count.comments}> 条</p>
                        <p><a href="__APP__/i/setting">[修改资料]</a>&nbsp;<?php if(isAdmin($_SESSION['uid'])) echo '<a href="__ROOT__/admin.php" target="_blank">[后台管理面板]</a>'; else echo'<a href="__APP__/i/feedback" title="有好的资料？遇到了bug？有建议？赶快反馈给我们！">[投稿&nbsp;&amp;&nbsp;反馈]</a>' ?></p>
                        </div>
                    </div>
                  	<div class="menu fr">
                    	<ul>
                        <li><a href="__APP__/i/history">历史记录</a></li>
                    	<li><a href="__APP__/i/fav">我的收藏</a></li>
                    	<li><a href="__APP__/i/message">我的消息<?php if(!isEmpty($userInfo['count']['comments'])) echo '('.$userInfo['count']['comments'].')'; ?> </a></li>
                        <div class="line"></div>
                  		<li><a href="/i/<{$userInfo.id}>">个人空间</a></li>
                    	<li><a href="__APP__/i/setting">个人设置</a></li>
                        <div class="line"></div>
                    	<li><a href="__APP__/u/logout">退&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;出</a></li>
                  		</ul>
                    </div>
              </div>
              <?php endif; ?>
            </div>
        </div>
    </div>